-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TF2] Carlini Wagner L2 #1156
[TF2] Carlini Wagner L2 #1156
Conversation
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
Hi @Joool I am trying to use this as
where
Detailed Error``` ValueError Traceback (most recent call last) in () 3 for (idx, (x, y)) in enumerate(test_dataset): 4 ----> 5 x_cwl2 = carlini_wagner_l2(model, x) 6 y_pred = model(x_cwl2) 7 test_cwl2_acc(y, y_pred)11 frames
|
Hi @vipinpillai sorry for the late response. I have tested code with the mnist tutorial for Tensorflow 2.3 with both GPU and CPU: x_cw2 = carlini_wagner_l2(model, x) I might need some more details to diagnose your error. |
@Joool Hi, I found the problem was related to batchsize. I was having |
Hi @Joool, the problem again comes up when I try to use an object created for
The error log is given below:
|
I also encounter the same problem with @v-i-s-h |
- bugfix in utils label function
- fixed early stopping criteria
135a90e
to
85bfc04
Compare
Hi @v-i-s-h and @hasanferit sorry for the long delay. I had several deadlines and had to setup a proper testing environment first. The batch mode should now work properly. |
@Joool Thanks! |
It has to be approved by one of the maintainers. |
Hi, seems there is more movement on this project. I resolved the conflicts with the current master branch. Implementing this I also set up a testing environment (essentially a port of pytorch tests). Since #1190 just got opened, should I open a pull request now or wait until the 4.0.0 release? |
Thank you @Joool for porting this feature to TF2! |
I ported the carlini wagner attack to tensorflow 2. I discovered that this is already been attempted in #1083. However, I needed the implementation for a current project, so I decided to still complete it and open a pull request, so other people can use it in the meantime.
Difference to tf1 version:
y
variable is set, we assume its a targeted attack[target_label] * len(x)
. I found that more intuitive since tf2 seems to prefer that for loss functions these daysNote:
This pull request includes the bugfix in #1151.